<template>
  <div class="available-orders-container">
    <el-card class="orders-card">
      <template #header>
        <div class="card-header">
          <h2>可接订单</h2>
          <el-button type="primary">
            <el-icon><Refresh /></el-icon>刷新列表
          </el-button>
        </div>
      </template>
      
      <div class="filter-container">
        <el-input
          v-model="searchQuery"
          placeholder="搜索区域、距离"
          class="search-input"
          clearable
        >
          <template #prefix>
            <el-icon><Search /></el-icon>
          </template>
        </el-input>
        
        <el-select v-model="distanceFilter" placeholder="距离范围" clearable class="filter-select">
          <el-option label="1公里内" value="1" />
          <el-option label="3公里内" value="3" />
          <el-option label="5公里内" value="5" />
          <el-option label="10公里内" value="10" />
        </el-select>
        
        <el-select v-model="sortBy" placeholder="排序方式" class="filter-select">
          <el-option label="距离优先" value="distance" />
          <el-option label="赏金优先" value="reward" />
          <el-option label="时间优先" value="time" />
        </el-select>
      </div>
      
      <div class="empty-placeholder" v-if="!hasData">
        <el-empty description="暂无可接订单"></el-empty>
      </div>
    </el-card>
  </div>
</template>

<script setup lang="ts">
import { ref } from 'vue'
import { Search, Refresh } from '@element-plus/icons-vue'

const searchQuery = ref('')
const distanceFilter = ref('')
const sortBy = ref('distance')
const hasData = ref(false)
</script>

<style scoped>
.available-orders-container {
  padding: 20px;
}

.orders-card {
  margin-bottom: 20px;
}

.card-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.card-header h2 {
  margin: 0;
  font-size: 18px;
  font-weight: 600;
}

.filter-container {
  margin: 20px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  align-items: center;
}

.search-input {
  width: 300px;
}

.filter-select {
  width: 150px;
}

.empty-placeholder {
  margin: 60px 0;
}

@media (max-width: 768px) {
  .filter-container {
    flex-direction: column;
    align-items: stretch;
  }
  
  .search-input, .filter-select {
    width: 100%;
  }
}
</style> 